<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>

<html
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:c="http://java.sun.com/jsp/jstl/core"
    xmlns:ui="http://java.sun.com/jsf/facelets">
    <h:head>
        <title>Thread: #{misterThread.newThreadEntity.title}</title>
    </h:head>
    <h:body>
        <h2>Vous avez rejoint le thread #{misterThread.newThreadEntity.title}}</h2>
        
        <div id="reply">
            <h3>Liste des messages :</h3>

            <h:dataTable value="#{obiwankenobean.myReplies(currentThread)}" var="replies"  border="1" >

                <h:column>
                    <f:facet name="header" >
                        <f:verbatim>Date</f:verbatim>
                    </f:facet>

                    <h:outputText value="#{replies.date}" title="myDate" />
                </h:column>

                <h:column >
                    <f:facet name="header" >
                        <f:verbatim>Pseudo :</f:verbatim>
                    </f:facet>

                    <h:outputText value="#{replies.myAuthor.pseudo}" title="userName" />
                </h:column>

                <h:column >
                    <f:facet name="header" >
                        <f:verbatim>Message</f:verbatim>
                    </f:facet>

                    <h:outputText value="#{replies.content}" title="textValue" />
                </h:column>

            </h:dataTable>
            
            <c:if test="${jarjarbean.userConnected == null}">
                <ui:include src="/reply/addReply.xhtml" />
            </c:if>
        </div>
    </h:body>
</html>
